package com.example.config;

import java.io.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

public class os {


    //字节流只适合图片视频
//    public static void main(String[] args)  {
//
//        try (
//                InputStream fileInputStream = new FileInputStream("D:\\company_project\\demo1\\src\\x.txt");
//                InputStream bis=new BufferedInputStream(fileInputStream);
//             OutputStream fileOutputStream = new FileOutputStream("D:\\company_project\\demo1\\src\\y.txt");
//             BufferedOutputStream bos=new BufferedOutputStream(fileOutputStream);
//
//        ) {
//            byte[] bytes = new byte[1];
//            int len;
//            while ((len = bis.read(bytes)) != -1) {
//                bos.write(bytes, 0, len);
//            }
//
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//
//
//    }


        public static void main(String[] args) {
            List<String> list = Arrays.asList("adnm", "admmt", "pot", "xbangd", "weoujgsd");
            List<String> collect = list.stream().map(s -> {
                if (s.length() > 5) {
                return s;
                }
                return null;
            }).filter(Objects::nonNull).collect(Collectors.toList());

            System.out.println(collect);
        }
}
